<template>
    <div class='input-code'>
        <my-input :id="id"  class='myInputs' :styles="styles" :disableds="disableds" :data="data" :isRequired="isRequired" :isreadonly="isreadonly" :exkey="exkey" :extype="extype" :dataField="dataField" :appid="appid"></my-input>
    </div>
</template>
<script>
import myInput  from './myInput.vue'
export default {
    name:"input-desk",
    props:['id','value','isCode','styles','disableds','data','isreadonly','index','isRequired','isPassword','exkey','extype','isSearch','dataField','isSearch2','fontSize'],
    components: {
        myInput
    },
    data(){
        return{
           oldValue:"",
           pId:"",
           cId:""
        }
    },
    created(){
        let ids=this.id.split(".");
        this.pId=ids[0];
        this.cId=ids[1];

    },
    methods:{
       
    },
    
    watch:{
       
         data:{
            handler: function (newVal) {
                let value=this.data[this.pId][this.cId];
                for(let i=0;i<this.data["item"].length;i++){
                    let szi_ex4=this.data["item"][i].szi_ex4;
                    let szi_ex2=this.data["item"][i].szi_ex2;
                    let szi_ex3=this.data["item"][i].szi_ex3;
                    if(szi_ex3.indexOf("桌")!=-1){
                        if(szi_ex4!=value){
                            let szi_ex5=Number(szi_ex2)*Number(value);
                            this.$set(this.data["item"][i],"szi_ex5",szi_ex5);
                            this.$set(this.data["item"][i],"szi_ex4",value);
                        }
                    }
                   
                }
            },      
            deep: true    //深度监听
         }
    }
}
</script>

<style scoped>
    .input-code{
        display:flex;
        flex-direction: row;
    }
    .butttonSelect{
        width:50px;
        margin-left:5px;
    }
    .myInputs{
        flex:1;
    }
</style>